import 'package:json_annotation/json_annotation.dart';

part 'video_item_model.g.dart';


@JsonSerializable()
class VideoItemModel extends Object {

  @JsonKey(name: 'type')
  String type;

  @JsonKey(name: 'data')
  VideoData data;

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'adIndex')
  int adIndex;

  VideoItemModel(this.type,this.data,this.id,this.adIndex,);

  factory VideoItemModel.fromJson(Map<String, dynamic> srcJson) => _$VideoItemModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoItemModelToJson(this);

}


@JsonSerializable()
class Header extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'icon')
  String icon;

  @JsonKey(name: 'iconType')
  String iconType;

  @JsonKey(name: 'title')
  String? title;

  @JsonKey(name: 'description')
  String? description;

  @JsonKey(name: 'actionUrl')
  String actionUrl;

  @JsonKey(name: 'issuerName')
  String? issuerName;

  @JsonKey(name: 'time')
  int? time;

  Header(this.id,this.icon,this.iconType,this.title,this.description,this.actionUrl,this.issuerName,this.time);

  factory Header.fromJson(Map<String, dynamic> srcJson) => _$HeaderFromJson(srcJson);

  Map<String, dynamic> toJson() => _$HeaderToJson(this);

}


@JsonSerializable()
class VideoData extends Object {

  @JsonKey(name: 'dataType')
  String dataType;

  @JsonKey(name: 'header')
  Header? header;

  @JsonKey(name: 'content')
  VideoItemModel? content;

  @JsonKey(name: 'itemList')
  List<VideoItemModel>? itemList;

  @JsonKey(name: 'id')
  int? id;

  @JsonKey(name: 'title')
  String? title;

  @JsonKey(name: 'description')
  String? description;

  @JsonKey(name: 'image')
  String? image;

  @JsonKey(name: 'actionUrl')
  String? actionUrl;

  @JsonKey(name: 'library')
  String? library;

  @JsonKey(name: 'tags')
  List<VideoTags>? tags;

  @JsonKey(name: 'consumption')
  Consumption? consumption;

  @JsonKey(name: 'resourceType')
  String? resourceType;

  @JsonKey(name: 'provider')
  Provider? provider;

  @JsonKey(name: 'category')
  String? category;

  @JsonKey(name: 'author')
  Author? author;

  @JsonKey(name: 'cover')
  Cover? cover;

  @JsonKey(name: 'playUrl')
  String? playUrl;

  @JsonKey(name: 'duration')
  int? duration;

  @JsonKey(name: 'webUrl')
  WebUrl? webUrl;

  @JsonKey(name: 'releaseTime')
  int? releaseTime;

  @JsonKey(name: 'playInfo')
  List<dynamic>? playInfo;

  @JsonKey(name: 'ad')
  bool? ad;

  @JsonKey(name: 'adTrack')
  List<dynamic>? adTrack;

  @JsonKey(name: 'type')
  String? type;

  @JsonKey(name: 'titlePgc')
  String? titlePgc;

  @JsonKey(name: 'descriptionPgc')
  String? descriptionPgc;

  @JsonKey(name: 'ifLimitVideo')
  bool? ifLimitVideo;

  @JsonKey(name: 'searchWeight')
  int? searchWeight;

  @JsonKey(name: 'idx')
  int? idx;

  @JsonKey(name: 'date')
  int? date;

  @JsonKey(name: 'labelList')
  List<dynamic>? labelList;

  @JsonKey(name: 'descriptionEditor')
  String? descriptionEditor;

  @JsonKey(name: 'collected')
  bool? collected;

  @JsonKey(name: 'reallyCollected')
  bool? reallyCollected;

  @JsonKey(name: 'played')
  bool?played;

  @JsonKey(name: 'subtitles')
  List<dynamic>? subtitles;

  VideoData(this.dataType,this.id,this.title,this.description,this.image,this.actionUrl,this.library,this.tags,this.consumption,this.resourceType,this.provider,this.category,this.author,this.cover,this.playUrl,this.duration,this.webUrl,this.releaseTime,this.playInfo,this.ad,this.adTrack,this.type,this.titlePgc,this.descriptionPgc,this.ifLimitVideo,this.searchWeight,this.idx,this.date,this.labelList,this.descriptionEditor,this.collected,this.reallyCollected,this.played,this.subtitles,);

  factory VideoData.fromJson(Map<String, dynamic> srcJson) => _$VideoDataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoDataToJson(this);

}


@JsonSerializable()
class VideoTags extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'actionUrl')
  String actionUrl;

  @JsonKey(name: 'desc')
  String? desc;

  @JsonKey(name: 'bgPicture')
  String? bgPicture;

  @JsonKey(name: 'headerImage')
  String? headerImage;

  @JsonKey(name: 'tagRecType')
  String? tagRecType;

  @JsonKey(name: 'haveReward')
  bool? haveReward;

  @JsonKey(name: 'ifNewest')
  bool? ifNewest;

  @JsonKey(name: 'communityIndex')
  int? communityIndex;

  VideoTags(this.id,this.name,this.actionUrl,this.desc,this.bgPicture,this.headerImage,this.tagRecType,this.haveReward,this.ifNewest,this.communityIndex,);

  factory VideoTags.fromJson(Map<String, dynamic> srcJson) => _$VideoTagsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VideoTagsToJson(this);

}


@JsonSerializable()
class Consumption extends Object {

  @JsonKey(name: 'collectionCount')
  int collectionCount;

  @JsonKey(name: 'shareCount')
  int shareCount;

  @JsonKey(name: 'replyCount')
  int replyCount;

  @JsonKey(name: 'realCollectionCount')
  int realCollectionCount;

  Consumption(this.collectionCount,this.shareCount,this.replyCount,this.realCollectionCount,);

  factory Consumption.fromJson(Map<String, dynamic> srcJson) => _$ConsumptionFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ConsumptionToJson(this);

}


@JsonSerializable()
class Provider extends Object {

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'alias')
  String alias;

  @JsonKey(name: 'icon')
  String icon;

  Provider(this.name,this.alias,this.icon,);

  factory Provider.fromJson(Map<String, dynamic> srcJson) => _$ProviderFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ProviderToJson(this);

}


@JsonSerializable()
class Author extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'icon')
  String icon;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'description')
  String description;

  @JsonKey(name: 'link')
  String link;

  @JsonKey(name: 'videoNum')
  int videoNum;

  @JsonKey(name: 'shield')
  Shield shield;

  @JsonKey(name: 'approvedNotReadyVideoCount')
  int approvedNotReadyVideoCount;

  @JsonKey(name: 'ifPgc')
  bool ifPgc;

  @JsonKey(name: 'recSort')
  int recSort;

  @JsonKey(name: 'expert')
  bool expert;

  Author(this.id,this.icon,this.name,this.description,this.link,this.videoNum,this.shield,this.approvedNotReadyVideoCount,this.ifPgc,this.recSort,this.expert,);

  factory Author.fromJson(Map<String, dynamic> srcJson) => _$AuthorFromJson(srcJson);

  Map<String, dynamic> toJson() => _$AuthorToJson(this);

}

@JsonSerializable()
class Shield extends Object {

  @JsonKey(name: 'itemType')
  String itemType;

  @JsonKey(name: 'itemId')
  int itemId;

  @JsonKey(name: 'shielded')
  bool shielded;

  Shield(this.itemType,this.itemId,this.shielded,);

  factory Shield.fromJson(Map<String, dynamic> srcJson) => _$ShieldFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ShieldToJson(this);

}


@JsonSerializable()
class Cover extends Object {

  @JsonKey(name: 'feed')
  String feed;

  @JsonKey(name: 'detail')
  String? detail;

  @JsonKey(name: 'blurred')
  String? blurred;

  @JsonKey(name: 'homepage')
  String? homepage;

  Cover(this.feed,this.detail,this.blurred,this.homepage,);

  factory Cover.fromJson(Map<String, dynamic> srcJson) => _$CoverFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CoverToJson(this);

}


@JsonSerializable()
class WebUrl extends Object {

  @JsonKey(name: 'raw')
  String raw;

  @JsonKey(name: 'forWeibo')
  String forWeibo;

  WebUrl(this.raw,this.forWeibo,);

  factory WebUrl.fromJson(Map<String, dynamic> srcJson) => _$WebUrlFromJson(srcJson);

  Map<String, dynamic> toJson() => _$WebUrlToJson(this);

}


